package org.cargloss.cp.controller.modul.feedback;

import java.util.Map;

import org.cargloss.cp.controller.modul.PageController;
import org.cargloss.cp.model.StaticPage;

import util.hibernate.DAO;

import com.opensymphony.xwork2.ActionSupport;

public class ActionPage extends ActionSupport {
	/**
         *
         */
	private static final long serialVersionUID = 1L;
	PageController pageControl = new PageController();
	private StaticPage staticPage;
	private int id;
	private Map<String, String> application;


	public Map<String, String> getApplication() {
		return application;
	}

	public void setApplication(Map<String, String> application) {
		this.application = application;
	}

	public String execute() {
		pageControl.setNavText("StaticPage");
		pageControl.setAll(true);
		return SUCCESS;
	}

	public String add() {
		return SUCCESS;
	}

	public String search() {
		return SUCCESS;
	}

	public String delete() {
		getObject();
		return SUCCESS;
	}

	public void getObject() {
		DAO<Integer> dao = new DAO<Integer>();
		dao.createCriteria(StaticPage.class);
		dao.addFilter("eq", "id", id);
		setStaticPage((StaticPage) dao.findUnique());
	}

	
	public String edit() {
		getObject();
		return SUCCESS;
	}

	public String detail() {
		getObject();
		return SUCCESS;
	}

	public String staticPage() {
		getObject();
		return SUCCESS;
	}

	public String preview() {
		getObject();
		return SUCCESS;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public PageController getPageControl() {
		return pageControl;
	}

	public void setPageControl(PageController pageControl) {
		this.pageControl = pageControl;
	}

	public StaticPage getStaticPage() {
		return staticPage;
	}

	public void setStaticPage(StaticPage staticPage) {
		this.staticPage = staticPage;
	}

}
